show_student = []


def student_info():
    name = input('请输入姓名')
    age = input('请输入年龄')
    show_dict = {'name': name, 'age': age}
    return show_dict


def show_info():
    a = 1
    print(f"-----学生列表信息-----")
    for show_dict in show_student:

        print(f'{a} name:\',{show_dict.get("name")}  \'age:\',{show_dict.get("age")} ')
        a += 1
    print(f"--------------------")

def stu_count():
    d = len(show_student)
    print(f"'学生总人数是':", d)

def search_stu():
    name = input('请输入要查询的学生姓名')
    for d in show_student:
        # print(d)
        if name == d.get('name'):
            print(f"姓名：{name}，年龄:{d.get('age')}")
    return
    print(f'对不起, 名字叫 [{name}]的学生不存在')


if __name__ == '__main__':
    for i in range(3):
        stu = student_info()
        show_student.append(stu)
        print(show_student)
        show_info()
        stu_count()
search_stu()
